import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

let defaultCity = '上海'
defaultCity = localStorage.city
export default new Vuex.Store({
  state: {
    cityName: defaultCity
  },
  mutations: {
    showCities(state, city) {
      state.cityName = city
      // 本地存储
      localStorage.city = city
    }
  }
})
